package com.zhongwang.mms.module.tool.service;

import ch.qos.logback.core.joran.spi.ElementSelector;
import com.zhongwang.mms.common.JsonResult;
import com.zhongwang.mms.module.tool.dao.AccEquipmentTypeDao;
import com.zhongwang.mms.module.tool.model.AccEquipmentTypeModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AccEquipmentTypeService {

    @Autowired
    private AccEquipmentTypeDao accEquipmentTypeDao;

    /**
     * 查询设备信息列表
     * @param model
     * @return
     */
    public List<AccEquipmentTypeModel> selectAccEquipmentTypeList(AccEquipmentTypeModel model){
        return accEquipmentTypeDao.selectAccEquipmentTypeList(model);
    }
    /**
     * 删除
     * @param typId 主键id
     * @return
     */
    public int deleteByPrimaryKey(Integer typId){
        return accEquipmentTypeDao.deleteByPrimaryKey(typId);
    }
    /**
     * 新增设备类型
     * @param record
     * @return
     */
    public int insert(AccEquipmentTypeModel record){
        return accEquipmentTypeDao.insert(record);
    }

    /**
     * 修改设备类型
     * @param record
     * @return
     */
    public int updateByPrimaryKey(AccEquipmentTypeModel record){
        return accEquipmentTypeDao.updateByPrimaryKey(record);
    }

    /**
     * 验证同一类型的是否存在
     * @param model AccEquipmentTypeModel
     * @return
     */
    public List<AccEquipmentTypeModel> findByTypeName(AccEquipmentTypeModel model){
        return accEquipmentTypeDao.findByTypeName(model);
    }
}
